package com.mathdroid.exceptionhandling;

/**
 * This exception is thrown if invalid values occur in a mathematical 
 * method. For example arguments that are out of bounds.
 */
public class DroidMathException extends Exception {
	/**
	 * Default UID.
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * The class, where the problem was caused.
	 */
	private Class<?> c = null;
	
	/**
	 * Constructor.
	 * @param s Explanation, why the exception was thrown.
	 * @param origin The origin.
	 */
	public DroidMathException(final String s, final Class<?> origin) {
		super(s);
		this.c = origin;
	}
	
	/**
	 * Get the origin of the exception.
	 * @return The origin of the exception.
	 */
	public final Class<?> getSource() {
		return this.c;
	}
}
